define (require, exports, module) ->
  require 'mods/custom_prod/custom_prod_css.css'

  module.exports = Vue.extend

    # 组件模板
    template: require 'mods/custom_prod/custom_prod_tpl.js'

    # 定义变量
    data: () ->
      # 是否加载完成
      loadedSucc: false
      # 加载失败提示语
      loadedFail: ''
      # 我的产品列表标题
      prodTitList:
        prod_name: "产品|代码"
        cur_amount: "份额(份)"
        buy_date: "买入日期"
        unit_net: "单位净值(日)"
        yjjz: "业绩基准"
        end_date: "到期日"
        handle: "操作"

      # 我的产品列表
      prodList: [
        {prod_name: "中兵广发定增2号", prod_code: "GF0292", cur_amount: "11001085.62", buy_date: "2015/10/30", unit_net: "0.9810", yjjz: "1%", prod_status: "已支付", handle: "查看"}
        {prod_name: "中兵广发定增2号", prod_code: "GF0292", cur_amount: "11001085.62", buy_date: "2015/10/30", unit_net: "0.9810", yjjz: "--", prod_status: "已支付", handle: "查看"}
        {prod_name: "中兵广发定增2号", prod_code: "GF0292", cur_amount: "11001085.62", buy_date: "2015/10/30", unit_net: "0.9810", yjjz: "--", prod_status: "未支付", handle: "支付"}
        {prod_name: "中兵广发定增2号", prod_code: "GF0292", cur_amount: "11001085.62", buy_date: "2015/10/30", unit_net: "0.9810", yjjz: "--", prod_status: "已支付", handle: "查看"}
        {prod_name: "中兵广发定增2号", prod_code: "GF0292", cur_amount: "11001085.62", buy_date: "2015/10/30", unit_net: "0.9810", yjjz: "--", prod_status: "未支付", handle: "支付"}
        {prod_name: "中兵广发定增2号", prod_code: "GF0292", cur_amount: "11001085.62", buy_date: "2015/10/30", unit_net: "0.9810", yjjz: "--", prod_status: "已支付", handle: "查看"}
        {prod_name: "中兵广发定增2号", prod_code: "GF0292", cur_amount: "11001085.62", buy_date: "2015/10/30", unit_net: "0.9810", yjjz: "--", prod_status: "已支付", handle: "查看"}
        {prod_name: "中兵广发定增2号", prod_code: "GF0292", cur_amount: "11001085.62", buy_date: "2015/10/30", unit_net: "0.9810", yjjz: "--", prod_status: "未支付", handle: "支付"}
        {prod_name: "中兵广发定增2号", prod_code: "GF0292", cur_amount: "11001085.62", buy_date: "2015/10/30", unit_net: "0.9810", yjjz: "--", prod_status: "已支付", handle: "查看"}
      ]

    # 定义方法
    methods:

      # 插件加载
      pluginLoad: () ->
        self = @

      # 加载成功
      loadedSuccFunc: () ->
        self = @
        self.$nextTick () ->
          # 加载成功标识
          self.loadedSucc = true
          # 插件加载
          self.pluginLoad()

    # 引用组件
    components:
      'c-info-side': require 'mods/info_side/info_side_mod'

    # 计算属性
    computed:

      # 加载中的样式
      loaddingClass: () ->
        self = @
        if self.loadedSucc
          return 'c-hidden'
        if self.loadedFail
          return 'c-hidden'
        return ''

      # 加载成功的样式
      loadedSuccClass: () ->
        self = @
        return if self.loadedSucc then '' else 'c-vhidden'

      # 加载失败的样式
      loadedFailClass: () ->
        self = @
        return if self.loadedFail then '' else 'c-hidden'

    # 组件初始化执行
    mounted: () ->
      self = @
      # 加载成功 - 处理函数
      return self.loadedSuccFunc()